package exp1;

import java.util.Scanner;

public class Fib1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int maxn = (int) 1e6 + 5;
        long [] fib = new long[maxn];
        fib[1] = 1;
        fib[2] = 1;
        int n = sc.nextInt();
        // start
        long stime = System.nanoTime();
        for (int i = 3; i <= n; i++) {
            fib[i] = fib[i - 1] + fib[i - 2];
        }
        // end
        long etime = System.nanoTime();
        System.out.println(fib[n]);
        System.out.println(etime - stime);
    }
}
